/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 沈明月
 * Date: 2022-11-02
 * Time: 22:58
 */
public class TestNineteen {
//递归求和：递归求 1 + 2 + 3 + ... + 10
    public static int SUM(int n) {
        if(n == 1){
            return 1;
        }
        return n+SUM(n-1);
    }
    public static void main(String[] args) {

        int n =  SUM(10);
        System.out.println(n);
    }
}
